from django.db import models
from django.contrib.auth.models import AbstractUser
# Create your models here.
from db.base import BaseModel

class UserInfo(AbstractUser,BaseModel):
    mobile_phone = models.CharField(verbose_name="用户名",max_length=64,unique=True,default="admin")
    email = models.CharField(verbose_name="邮箱",max_length=32,null=True)
    img_code = models.CharField(verbose_name="头像文件名",max_length=32,null=True)
    nickname = models.CharField(verbose_name="昵称",max_length=32,null=True,blank=True)
    cover = models.ImageField(upload_to='cover',verbose_name="用户头像",blank=True,null=True)

    def __str__(self):
        return self.username

    class Meta:
        db_table = "wx_account"
        verbose_name="用户表"
        verbose_name_plural = verbose_name